
package gov.chinatax.ctcps.generator.form;

import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for syCjwt.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="syCjwtForm"
 */
public class SyCjwtForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _wtbh = null;
   private java.lang.String _wtbt = null;
   private java.lang.String _da = null;
   private java.lang.String _fj = null;
   private java.lang.String _xwtBz = null;
   private java.lang.String _rq = null;
   private java.lang.String _xh = null;
   private java.lang.String _zt1 = null;
   private java.lang.String _zt2 = null;

   /**
    * Standard constructor.
    */
   public SyCjwtForm() {
   }

   /**
    * Returns the wtbh
    *
    * @return the wtbh
    */
   public java.lang.String getWtbh() {
      return _wtbh;
   }

   /**
    * Sets the wtbh
    *
    * @param wtbh the new wtbh value
    */
   public void setWtbh(java.lang.String wtbh) {
      _wtbh = wtbh;
   }
   /**
    * Returns the wtbt
    *
    * @return the wtbt
    */
   public java.lang.String getWtbt() {
      return _wtbt;
   }

   /**
    * Sets the wtbt
    *
    * @param wtbt the new wtbt value
    */
   public void setWtbt(java.lang.String wtbt) {
      _wtbt = wtbt;
   }
   /**
    * Returns the da
    *
    * @return the da
    */
   public java.lang.String getDa() {
      return _da;
   }

   /**
    * Sets the da
    *
    * @param da the new da value
    */
   public void setDa(java.lang.String da) {
      _da = da;
   }
   /**
    * Returns the fj
    *
    * @return the fj
    */
   public java.lang.String getFj() {
      return _fj;
   }

   /**
    * Sets the fj
    *
    * @param fj the new fj value
    */
   public void setFj(java.lang.String fj) {
      _fj = fj;
   }
   /**
    * Returns the xwtBz
    *
    * @return the xwtBz
    */
   public java.lang.String getXwtBz() {
      return _xwtBz;
   }

   /**
    * Sets the xwtBz
    *
    * @param xwtBz the new xwtBz value
    */
   public void setXwtBz(java.lang.String xwtBz) {
      _xwtBz = xwtBz;
   }
   /**
    * Returns the rq
    *
    * @return the rq
    */
   public java.lang.String getRq() {
      return _rq;
   }

   /**
    * Sets the rq
    *
    * @param rq the new rq value
    */
   public void setRq(java.lang.String rq) {
      _rq = rq;
   }
   /**
    * Returns the xh
    *
    * @return the xh
    */
   public java.lang.String getXh() {
      return _xh;
   }

   /**
    * Sets the xh
    *
    * @param xh the new xh value
    */
   public void setXh(java.lang.String xh) {
      _xh = xh;
   }
   /**
    * Returns the zt1
    *
    * @return the zt1
    */
   public java.lang.String getZt1() {
      return _zt1;
   }

   /**
    * Sets the zt1
    *
    * @param zt1 the new zt1 value
    */
   public void setZt1(java.lang.String zt1) {
      _zt1 = zt1;
   }
   /**
    * Returns the zt2
    *
    * @return the zt2
    */
   public java.lang.String getZt2() {
      return _zt2;
   }

   /**
    * Sets the zt2
    *
    * @param zt2 the new zt2 value
    */
   public void setZt2(java.lang.String zt2) {
      _zt2 = zt2;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getWtbh() == null) {
         errors.add("wtbh", new ActionError("error.wtbh.required"));
      }
      if(getWtbt() == null) {
         errors.add("wtbt", new ActionError("error.wtbt.required"));
      }
      if(getXwtBz() == null) {
         errors.add("xwtBz", new ActionError("error.xwtBz.required"));
      }
      if(getRq() == null) {
         errors.add("rq", new ActionError("error.rq.required"));
      }
      // TODO test format/data
      return errors;
   }
}
